Method and unit for substracting quantization noise from a pcm signal

ABSTRACT

The invention relates to method and unit for substracting quanti zafion noise from a pulse code modulated PCM signal being segmented into frames. For achieving this it is proposed to first calculate for each frame of said PCM signal a quantization noise level Bq according to the following equation (I) wherein n indicates a specific sample of the PCM signal, S* min [n] represents the minim um quantization noise level for a specific sample value s*[n] of said PCM signal, S* max [n] represents the maximum quantization noise level for the specific sample value s*[n] of the PCM signal, w[n] represents a window-function and W represents the number of samples per window. Subsequently, the quantization noise as represented by said quantization noise level Bq has to be substracted from said PCM signal, preferably with the help of a suitable background noise substracting system.  
               B   q     =         ∑     n   =   0       W   -   1       ⁢         {       (         s   min   *     ⁡     [   n   ]       -       s   max   *     ⁡     [   n   ]         )     ·     w   ⁡     [   n   ]         }     2     12                 (   I   )

The invention relates to a method and a unit for substractingquantization noise from a PCM signal.

Pulse code modulation (PCM) is a widely used technique to represent e.g.audio signals in the digital domain. Linear PCM uses evenly distributedquantization levels whereas the logarithmic PCM uses a distributionwhere small-signal amplitudes are quantized using more closely spacedlevels than large-signal amplitudes. An example to linear PCM is theCD-audio, which uses 16 bits to represent uniformly distributed signallevels.

FIG. 5 illustrates the quantization of a linear coded PCM signalamplitudes (curve (a)) and of two logarithmically coded PCM signalamplitudes (curve (b) and (c)). Cuve b illustrates the quantization ofclaw coded PCM signal amplitudes, wherein the claw has an input-outputmagnitude characteristic of the form: $\begin{matrix}{{|y| = \frac{\log\left( \left. {1 + \mu} \middle| s \right| \right)}{\log\left( {1 + \mu} \right)}},} & (1)\end{matrix}$where |s| is the magnitude of the input, |y| is the magnitude of theoutput and μ is a parameter that is selected to give the desiredcompression characteristic.

In FIG. 5 curve c) illustrates the quantization of A-law coded PCMsignal amplitudes, wherein the A-law has an input-output magnitudecharacteristic of the form: $\begin{matrix}{{|y| = \frac{\left. {1 + {\log\quad A}} \middle| s \right|}{1 + {\log\quad A}}},} & (2)\end{matrix}$wherein the meaning of y and s is as mentioned above and A is constant.The prior art μ-law and A-law coders are standardized by the ComitéConsultatif International de Téléfonique et Télégraphique CCITT as theG.711 64 kbit/s PCM. The quantizer characteristics of the G.711 aredisclosed in: N. S. Jayant and P. Noll, “Digital Coding of Waveforms”,Englewood Cliffs N.J.: Prentice-Hall, 1984.

The quantized sample values of a signal may be modeled mathematically ass*[n]=s[n]+q[n]  (3)wherein S*[n] represents the quantized value of an original unquantizedsample value s[n] and q[n] represents the quantization error resultingfrom said quantization. The quantization error can be interpreted asundesired additive noise decreasing the quality of the original samplevalues s[n].

Thus, it is the object of the invention to provide a method and a unitfor substracting said quantization noise from a PCM signal.

This object is solved by a method comprising the steps of:

-   calculating for each frame of said PCM signal a quantization noise    level Bq according to the following equation:    $B_{q} = \sqrt{\sum\limits_{n = 0}^{W - 1}\frac{\left\{ {\left( {{s_{\min}^{*}\lbrack n\rbrack} - {s_{\max}^{*}\lbrack n\rbrack}} \right) \cdot {w\lbrack n\rbrack}} \right\}^{2}}{12}}$    wherein-   n: indicates a specific sample of the PCM signal;-   S*_(min)[n]: represents the minimum quantization noise level for a    specific sample value s*[n] of said PCM signal;-   S*_(max)[n]: represents the maximum quantization noise level for the    specific sample value s*[n] of the PCM signal;-   w[n]: represents a window-function; and-   W: represents the number of samples per window; and    substracting the quantization noise as represented by said    quantization noise level Bq from said PCM signal.

It is the essential idea of the invention to calculate said quantizationnoise levels Bq for each frame according to the claimed formula and touse any suitable (background) noise substracting method known in theart—perhaps after carrying out slight modifications—to substract thequantization noise from the PCM signal.

Throughout the whole description * indicates the content of quantizationnoise n the co-ordinated quantity or signal.

The window-function may be chosen arbitrarily

The claimed formula requires the minimum quantization level S*_(min)[n]as well as on the maximum quantization level S*_(max)[n] of the samplevalues s*[n] of the PCM signal.

According to a first advantageous embodiment of the invention theminimum quantization level S*_(min)[n] as well as the maximumquantization level S*_(max)[n] are known from the quantization methodapplied for generating the PCM signal.

According to a second embodiment said quantization levels S*_(min)[n]and S*_(max)[n] are not known and must therefore be predicted accordingto the formulas claimed in claim 3.

Advantageously neither in the first nor in the second embodiment anyadditional information must transmitted together with the PCM samplevalues s*[n] to enable the conduction of the claimed method. This isbecause in the first embodiment the quantization levels and in thesecond embodiment reference levels i can be assumed to be known (see thelast two paragraphs above) when the method for substracting thequantization noise according to the invention is carried out. Because ofthat advantageously bandwidth is saved.

Preferably, the noise substraction is based on a background noisesubstracting method and system as described in the non-prepublishedEuropean Patent application having the application number EP 01201304.1of the same applicant. The application of said system is described lateras preferred embodiment. The whole content of said patent applicationshall be regarded as part of the disclosure of the present application.

Finally, the above-identified object is solved by a noise substractingunit according to the subject matter of claim 9. The advantages of saidunit correspond to the advantages mentioned above referring to theclaimed method.

Preferably, the claimed unit and method are applied at the decoder side,i.e. just before the PCM signal is decoded again. However, neverthelessit might also be applied at the encoder side.

The description is accompanied by five figures, wherein

FIG. 1 shows a quantization noise substracting unit according to theinvention including the background noise subtracting unit;

FIG. 2 shows an example for illustrating the correlation betweenreference values I and sample values S*[n];

FIG. 3 shoes a detailed illustration of a background noise substractingunit;

FIG. 4.1. shows the spectrum of a clean male voice;

FIG. 4.2. shows the μ-law coded version of the spectrum shown in FIG.4.1.;

FIG. 4.3. shows the μ-law coded version of the spectrum shown in FIG.4.1. after quantization noise substraction according to the invention;

FIG. 4.4. shows the usage array u[i] generated for applying thequantization noise substraction method to the spectrum shown in FIG.4.2;

FIG. 5 showing quantization levels for linearly and non-linearly codedPCM-signals as known in the art.

In the following a preferred embodiment of the invention will bedescribed by referring to FIGS. 1-4.

FIG. 1 shows a quantization noise substracting unit 100-700 forsubstracting quantization noise from an input linearly orlogarithmically coded PCM signal.

First of all said unit comprises a quantization noise level calculatingunit 100 for calculating a quantization noise level Bq for each frame ofsaid PCM signal under consideration of both a minimum and a maximumquantization noise level S*_(min)[n], S*_(max)[n]. More specifically,the quantization noise level Bq is constant for each frame of said PCMsignal and calculated individually for a specific frame according to thefollowing equation:$B_{q} = \sqrt{\sum\limits_{n = 0}^{W - 1}\frac{\left\{ {\left( {{s_{\min}^{*}\lbrack n\rbrack} - {s_{{(4)}\max}^{*}\lbrack n\rbrack}} \right) \cdot {w\lbrack n\rbrack}} \right\}^{2}}{12}}$wherein

-   n: indicates a specific sample of the PCM signal;-   S*_(min)[n]: represents the minimum quantization noise level for a    specific sample value s*[n] of said PCM signal;-   S*_(max)[n] : represents the maximum quantization noise level for    the specific sample value s*[n] of the PCM signal;-   w[n]: represents a window-function; and-   W: represents the number of samples per window comprising at least    the specific frame for which Bq is currently calculated.    Typically, the number of samples per window is twice the number of    samples per frame. In equation 4 the term    $\frac{\left\{ {\left( {{s_{\min}^{*}\lbrack n\rbrack} - {s_{\max}^{*}\lbrack n\rbrack}} \right) \cdot {w\lbrack n\rbrack}} \right\}^{2}}{12} = ɛ$    represents the mean square value of the quantization error, i.e. the    energy of the quantization noise in the current frame.

The frame size is typically 2 ms.

According to a first embodiment said quantization noise levelsS*_(min)[n], S*_(max)[n] are assumed to be known.

However, according to a second embodiment of the invention thesequantization levels S*_(min)[n], S*_(max)[n] are not assumed to beknown, e.g. because the original signals might have been quantized withdifferent quantizers and there may have been extra scalings applied onthe samples before or after coding. In these cases the quantizationlevels have to be predicted.

To predict the quantization levels, the entire original signal,hereinafter also referred to as waveform, is scanned to receive thesample values s*[n] of the quantized waveform. Subsequently, a check ismade, if all possible representation levels i predefined due thequantization method applied to the waveform are represented (used) by atleast one said sample values s*[n]. For a 16-bit linear PCM quantizationmethod there are 2¹⁶=65536 possible representation levels i and theresult of said check is described in a so called usage table u[i] with65536 values. The values of said usage table u[i] are either 1 (if thereis at least one sample value of the whole waveform corresponding to thecurrent representation level i) or 0 (if there is no sample value of thewhole waveform corresponding to the current representation level i).Expressed mathematically $\begin{matrix}{{u(i)} = {\min\left( {1,{\sum\limits_{n = 0}^{L - 1}\left\{ \begin{matrix}{0,} & {{s^{*}\lbrack n\rbrack} \neq i} \\{1,} & {otherwise}\end{matrix} \right)},{{- 2^{N - 1}} \leq i < 2^{N - 1}}} \right.}} & (5)\end{matrix}$

In formula (5) L is the waveform length, i.e. the number of samples ofthe whole waveform, and N is the number of bits used by the linear PCMquantization; in the above example N=16. This operation can besimplified by initializing all values of u[i] with 0 and using formula(6):u[s*[n]]=1, 0≦n<L  (6)

Now equations (5) or (6) are used to find special representation levelsi_(min)[n] and i_(max)[n] required for predicting the desiredquantization levels. More specifically, i_(min)[n] is defined as thatrepresentation level which is—startet from i[n]—the next smallernon-zero representation level for which u[n]=1 and i_(max)[n] is definedas that representation level which is—started from i[n]—the next biggernon-zero representation level for which u[n]=1.

With the help of said co-ordinated representation levels the desiredquantization levels are predicted or calculated according to thefollowing equations:s* _(min) =i[n]−(i[n])−i _(min) [n])/2  (7)S* _(max) =i[n]+(i_(max) [n]−i[n])/2  (8)wherein

-   i: represents one out of a plurality of predefined possible    representation levels;-   i[n]: represents that predefined representation level which    corresponds to the sample value s*[n].

FIG. 2 illustrates the calculation of the usage array, of said specialrepresentation levels i_(min)[n], i_(max)[n] and of the desiredquantization levels S*_(min)[n], S*_(max)[n] for a given waveformconsisting of L=9 sample values S*[n] which are in the exampledistributed as shown in Tab. 1: TABLE 1 n 1 2 3 4 5 6 7 8 9 s*[n] = 3 2−1 −1 2 1 1 3 −3 i[n]

In FIG. 2 there are provided 8 different possible representation levelsi=−4, . . . −1, 0, 1, . . . , 3 resulting from a N=3 bit linear PCMquantization. The usage array u[i] calculated according to equation (5)or (6) for the example of Tab. 1 is:u[−3]=u[−1]=u[1]=u[2]=u[3]=1; andu[−4]=u[−2]=u[0]=0

Now, from said usage array the reference levels i_(min)[n] andi_(max)[n] are calculated e.g. for n=2 with s*[2]=i[2]=1—according tothe definition given above—to:i _(max)[2]=2 and i _(min)[2]=−1and the desired quantization levels result—according to equations (7)and (8) to:s*_(min)=1−(1−(−1))/2=0S*_(max)=1+(2−1)/2=1,5

Special care has to be taken when i[n] co-ordinated to s*[n] is thefirst or last non-zero value in the usage-array u. One option is toallocate two extra array values u[−2^(N−1)−1] and u[2^(N−1)], set themboth to 1 and always continue the search until a non-zero value isfound.

Another question is what to do when some valid quantization levelsaren't used in the waveform. Especially waveforms shorter than 1 secondwill result in a usage-array with many unused (but valid) quantizationlevels. Since this usually will give a wrong result for the quantizationstep-size at boundaries (when the waveform is at its maximum or minimumvalue), the effect on the measured level of quantization noise will besmall. Although an algorithm could be used to predict the unused validquantization levels, the added value of the extra complexity is notworth the performance gain. In practice, it seems to be enough to assumethat the used signal levels in the waveform are the only valid levels.

After the quantization noise level Bq has been calculated either withthe known or with the predicted quantization levels s*_(min) ands*_(max) it is input into a background noise substracting unit BNS 200which is also part of said quantization noise substracting unit.

FIG. 3 shows a detailed illustration of said background noisesubstracting unit 200 which is embodied to substract the quantizationnoise from a PCM signal in the frequency domain. It comprises amagnitude forming unit 210 for forming the magnitude |S*[k]| of thespectrum S*[k] of the PCM signal, a signal-to-noise ratio calculatingunit 220 for calculating the signal-to-noise ratio of the PCM signalaccording to the formula:SNR[k]=|S*[k]|/Bq,  (9)wherein Bq is noise level representing the level of quantization noisein said PCM signal.

Said signal-to-noise ratio SNR[k] is input into a filter update unit 230for calculating a filter magnitude F[k] according to a predefined filteralgorithm based on at least one filter update parameter. Said filtermagnitude F[k] is input into a calculation unit 240 for calculating anoutput spectrum S^(b)[k] by multiplying both the real part R{S*[k]} andthe imaginary part I{S*[k]} of the spectrum S*[k] with said filtermagnitude F{k}. The filter update parameter and thus also the filtermagnitude F[k] are preferably adjusted such that output spectrumS^(b)[k] is at least substantially free of quantization noise.

Because said background noise substracting unit 200 is embodied to carryout the substraction of the quantization noise in the frequency domain,the quantization noise substracting unit further comprises several unitsfor computing the spectrum S*[k] of the PCM signal to be input into saidbackground noise substracting unit 200 and for transforming the spectrumS^(b)[k] output by said unit 200 back into a time domain signal. Theseunits are described in the following paragraphs.

Referring back to FIG. 1 the quantization noise substracting unitfurther comprises a first window block 300 for generating a weighted PCMsignal s*_(w)[n] by weighting the frames of the input PCM signal with afirst window w1[n]. Said weighted PCM signal s*_(w)[n] is input into aspectrum computing unit 400 for computing the spectrum S*[k] from saidweighted signal. Preferably, the spectrum is computed by using the FastFourier Transformation algorithm. The spectrum S*[k] is than input intothe background noise substracting unit 200 and processed therein asdescribed above by referring to FIG. 3.

The spectrum S^(b)[k] output by said background substracting unit 200 isinput into a re-transforming unit 500 for being transformed back into asignal s^(b)[n] in the time domain. In the case that the spectrum S*[k]has been calculated by using FFT the re-transformation is done by usingthe inverse FFT.

The quantization noise substracting unit may further comprise a secondwindow block 600 for generating a weighted output signal s^(b) _(w)[n]by weighting the signal s^(b)[n] received after the transformation witha second window W2[n] and an overlap and add unit 700 for individuallycalculating a final output signal Ŝ_(w) ^(b)[n] for each frame of thePCM-signal from said weighted output signal s^(b) _(w)[n] such that thetransition between two successive output frames is smoothed. The firstand the second window W1 and W2 are preferably identical. They areindependent of the window-function w[n] used for calculating thequantization noise level Bq. However, it is preferred to use the samefunction for w[n] as for W1.

The provision of the overlap and add unit 700 only improves the qualityof the output signal but it is not absolutely necessary for carrying outthe quantization noise substraction; consequently, it might be left out.The same applies to the first and the second window block 300 and 600which are both only provided to improve the operation said overlap andadd unit 700.

FIG. 4 shows an example illustrating the good signal quality achievedwhen applying the claimed method to a μ-law coded speech signal.

More specifically, FIG. 4.1 shows the spectrum of a clean, i.e. free ofquantization noise, male voice recording with the utterance: “Anydictionary will give at least twenty different definitions for it”. FIG.4.2. shows the μ-law coded version of the spectrum shown in FIG. 4.1.From that FIG. 4.2. it can be seen that said μ-law coding causesquantization noise added to the clean spectrum of FIG. 4.1. In FIG. 4.2.the quantization noise is represented by the grey-shaded areas 410; thecorresponding areas in FIG. 4.1 are clean. FIG. 4.3. shows the spectrumfrom FIG. 4.2 after the quantization noise substracting method accordingto the invention has been applied. It can been seen that this spectrumsubstantially corresponds to original clean spectrum shown in FIG. 4.1;that means that the method according to the invention is well able toclean the spectrum of a PCM signal from quantization noise. FIG. 4.4shows the usage array u[i] as generated by the method according to thepresent invention for reducing quantization noise from the spectrumshown in FIG. 4.2.

1. A method for substracting quantization noise from a pulse codemodulated PCM signal being segmented into frames, comprising the stepsof: calculating for each frame of said PCM signal a constantquantization noise level Bq according to the following equation:$B_{q} = \sqrt{\sum\limits_{n = 0}^{W - 1}\frac{\left\{ {\left( {{s_{\min}^{*}\lbrack n\rbrack} - {s_{\max}^{*}\lbrack n\rbrack}} \right) \cdot {w\lbrack n\rbrack}} \right\}^{2}}{12}}$wherein n: indicates a specific sample of the PCM signal; S*_(min)[n] :represents the minimum quantization noise level for a specific samplevalue s*[n] of said PCM signal; S*_(max)[n]: presents the maximumquantization noise level for the specific sample value s*[n] of the PCMsignal; w[n]: represents a window-function; and W: represents the numberof samples per window; and substracting the quantization noise asrepresented by said quantization noise level Bq from said PCM signal. 2.The method according to claim 1, characterized in that the minimumquantization level S*_(min) as well as the maximum quantization levelS*_(max) are known.
 3. The method according to claim 1, characterized inthat the minimum quantization level S*_(min) and the maximumquantization level S*_(max) are predicted according to the followingequations:S* _(min) =i[n]−(i[n]−i _(min) [n])/2S* _(max) =i[n]+(i _(max) [n]−i[n])/2 wherein i: represents one out of aplurality of possible representation levels predefined due to thespecific PCM quantization method applied to an original signal; i[n]:represents that predefined representation level which corresponds to thesample value s*[n] for a specific n; i_(min)[n]: represents thatrepresentation level which is—startet from i[n]—the next smallernon-zero representation level for which u[n]=1; i_(max)[n]: representsthat representation level which is—startet from i[n]—the next biggernon-zero representation level for which u[n]=1; with the usage arrayu[i] being defined to:${u(i)} = {\min\left( {1,{\sum\limits_{n = 0}^{L - 1}\left\{ \begin{matrix}{0,} & {{s^{*}\lbrack n\rbrack} \neq i} \\{1,} & {otherwise}\end{matrix} \right)},{{- 2^{N - 1}} \leq i < 2^{N - 1}}} \right.}$wherein L: represents the number samples of the whole PCM-signal; and N:represents the number of bits used for quantizing an original samplevalue by using PCM to generate the PCM sample values s*[n].
 4. Themethod according to claim 1, characterized in that the substracting ofthe quantization noise represented by said quantization noise level Bqfrom the PCM-signal is carried out in the frequency domain according tothe following steps: computing the spectrum S*[k] of the PCM signals*[n] and forming the magnitude |S*[k]| thereof; computing asignal-to-noise ratio SNR[k] of said spectrum S*[k] according to:SNR[k]=|S*[k]|/Bq; calculating from said signal-to-noise ratio SNR[k] afilter magnitude F[k] according to a predefined filter algorithm basedon at least one filter update parameter; calculating an output spectrumS^(b)[k] at least substantially free of said quantization noise bymultiplying both the real part R{S*[k]} and the imaginary part I{S*[k]}of the spectrum S*[k] with said filter magnitude F{k}; and transformingthe output spectrum S^(b)[k] back into a signal s^(b)[n] in the timedomain.
 5. The method according to claim 4, characterized in that thefilter update parameter and thus the filter magnitude F[k] are adjustedsuch that the quantization noise in the remaining output spectrumS^(b)[k] is as low as possible.
 6. The method according to claim 4,characterized in that it further comprises the steps of: weighting theframes of the input PCM signal with a first window w1[n] and calculatingthe spectrum S*[k] from said weighted signal; generating a weightedoutput signal s^(b) _(w)[n] by weighting the signal s^(b)[n] receivedafter the re-transformation with a second window W2[n]; and calculatinga final output signal Ŝ_(w) ^(b)[n] for a current frame of thePCM-signal from said weighted output signal s^(b) _(w)[n] such that thetransition between two successive output frames and is smoothed.
 7. Themethod according to claim 4, characterized in that the computation ofthe spectrum S*[k] of the PCM signal is done by using a Fast FourierTransformation FFT; and the re-transforming the output spectrum S^(b)[k]back into a time domain signal s^(b)[n] is done by using an inverse FFT.8. The method according to claim 6, characterized in that the first andthe second window w1 and w2 are identical.
 9. A quantization noisesubstracting unit for substracting quantization noise from a pulse codemodulated PCM signal being segmented into frames, comprising: aquantization noise level calculating unit (100) for calculating for eachframe of said PCM signal a constant quantization noise level Bqaccording to the following equation:$B_{q} = \sqrt{\sum\limits_{n = 0}^{W - 1}\frac{\left\{ {\left( {{s_{\min}^{*}\lbrack n\rbrack} - {s_{{(3)}\max}^{*}\lbrack n\rbrack}} \right) \cdot {w\lbrack n\rbrack}} \right\}^{2}}{12}}$wherein n: indicates a specific sample of the PCM signal; S*_(min)[n]:represents the minimum quantization noise level for a specific samplevalue s*[n] of said PCM signal; S*_(max)[n]: represents the maximumquantization noise level for the specific sample value s*[n] of the PCMsignal; w[n]: represents a window-function; and W: represents the numberof samples per window; and a background noise substracting unit (200)for substracting the quantization noise as represented by saidquantization noise level Bq from said PCM signal.
 10. The noisesubstracting unit according to claim 9, characterized in that it islocated at a decoder's side.